#ifndef _GAME_SCENE_MANAGER_H_
#define _GAME_SCENE_MANAGER_H_

//#include "GameSystemManager.h"
//#include "GameSceneManager.h"

//class myCEGUI;
//class InputHandler;
//class WindowEventHandler;
//class CCamera;

#include "Ogre.h"
#include "XMLHandler.h"

#include <windows.h>
#include <stdio.h>
#include <iostream>

using namespace Ogre;
using namespace std;
using std::string;

enum BrushType
{
	BRUSH_DEFORM = 0,
	BRUSH_PAINT = 1,
	BRUSH_OBJECT = 2,
	BRUSH_FOLIAGE = 3,
};

class GameSceneManager {
public:
	GameSceneManager();
	~GameSceneManager();
	
	static GameSceneManager *getSingleton();

	Root* getRoot();
	SceneManager* getSceneManager();
	Viewport* getViewport();
	Camera* getCamera();

	void create();
	void saveMap(std::string mapFileName);
	void loadMap(std::string mapFileName);
	void loadSceneFile(std::string sceneFile);

	//void startScene(Ogre::Root*,Camera*,Viewport*,SceneManager*,RenderWindow*);
	void setupSceneManager();
	void setupLights();
	void createCamera();
	void start();
	unsigned int getBrush();
	void setBrush(unsigned int);
	std::string getObjectNameFromMousePos();
	std::string getObjectNameFromCrosshair();
	Ogre::RaySceneQueryResult getOgreObjectsFromMousePos();

	Ogre::SceneNode* getCameraNode();
	Ogre::SceneNode* getCameraPitchNode();
	Ogre::SceneNode* getCameraYawNode();

	std::string currentMapName;
	
	static XMLHandler* xmlh;
	std::string currentMap;
	//static TiXmlHandle* hDoc;
	//static TiXmlElement* pElem;
	//static TiXmlHandle* hRoot;

private:
	
	static Root *mRoot;
	static Camera* mCamera;
	static SceneNode* mCameraNode;
	static SceneNode* mCameraPitchNode;
	static SceneNode* mCameraYawNode;

	static Viewport *mViewport;
	static SceneManager* mSceneMgr;
	static RenderWindow* mWindow;
	
	unsigned int mCurrentBrush;
	//std::string objectInHand;

	//static InputListener* mFrameListener;

	static GameSceneManager *mInstance;

};

#endif
